<?php


include './sdk/We.class.php';
include './sdk/jssdk.php';
$jssdk = new JSSDK();
$signPackage = $jssdk->GetSignPackage();
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width,user-scalable=no,initial-scale=1.0" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <title>华兴对对碰</title>
    <link type="text/css" href="css/game_base.css" rel="stylesheet" />
    <script type="text/javascript" src="js/jquery-2.1.0.min.js"></script>
    <script type="text/javascript" src="js/jquery.cookie.js"></script>
    <script type="text/javascript" src="js/game_base.js"></script>
    <script type="text/javascript" src="js/createjs-2013.12.12.min.js"></script>
    <script type="text/javascript" src="js/createjs_game.js"></script>
    <script type="text/javascript" src="js/main.js"></script>
    <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>

    <style type="text/css">
        .follow {
            z-index: 100;
            position: absolute;
            left: -500px;
            bottom: 0px;
            width: 20%;
            opacity: 0;
        }

        .follow img {
            width: 100%
        }

        .moreGames {
            z-index: 100;
            position: absolute;
            bottom: 10px;
            margin-left: auto;
            margin-right: auto;
            width: 100%;
            text-align: center;
        }

        .moreGames a {
            font: 11px Arial;
            text-decoration: none;
            background-color: #C0C0C0;
            color: #FFFFFF;
            padding: 2px 10px 2px 10px;
            border-radius: 8px;
            -webkit-border-radius: 8px;
        }
    </style>
</head>
<body>
<audio autoplay="autoplay" >
    <source src="bg.mp3" type="audio/mpeg">
</audio>
<canvas id="stage">
    您的浏览器不支持html5, 请换用支持html5的浏览器
</canvas>
<script language=javascript>

    var mebtnopenurl = 'http://api.mtaction.com/dian/huaxing-limit/index.php'; //更多游戏链接
    window.shareData = {
        "imgUrl": "http://api.mtaction.com/dian/huaxing/img/icon.png", //分享朋友圈时的图标
        "timeLineLink": "http://api.mtaction.com/dian/huaxing-limit/index.php", //分享朋友圈时的URL
        "tTitle": "华兴对对碰", //分享朋友圈时的标题
        "tContent": "点击进入，参与挑战" //分享朋友圈时的内容
    };

    function goHome(){
        window.location=mebtnopenurl;
    }
    function dp_share(){
        document.title = "我在挑战华兴对对碰，你敢来吗？";
        document.getElementById("share").style.display="";
        window.shareData.tTitle = document.title;
    }
    function dp_Ranking(){
        //alert("到更多");
        window.location=mebtnopenurl;
    }

    function showAd(){
    }
    function hideAd(){
    }
    wx.config({
        debug: false,
        appId: "<?php echo $signPackage['appId'];?>",
        timestamp: "<?php echo $signPackage['timestamp'];?>",
        nonceStr: "<?php echo $signPackage['nonceStr'];?>",
        signature: "<?php echo $signPackage['signature'];?>",
        jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage'] // 功能列表
    });
    wx.ready(function(){
        wx.onMenuShareTimeline({
            title: '我在挑战华兴对对碰，你敢来吗？', // 分享标题
            link:"http://api.mtaction.com/dian/huaxing-limit/index.php",
            imgUrl: "http://api.mtaction.com/dian/huaxing/img/logo.png",
            trigger:(res)=>{console.log('分享前')},
            success:()=>{},
            fail:(res)=>{console.log("分享失败")},
            cancel:()=>{console.log("分享取消")}
        });

        wx.onMenuShareAppMessage({
            title: '我在挑战华兴对对碰，你敢来吗？', // 分享标题
            desc: "点击进入，参与挑战", // 分享描述
            link:"http://api.mtaction.com/dian/huaxing-limit/index.php",
            imgUrl: "http://api.mtaction.com/dian/huaxing/img/logo.png",
            type: 'link', // 分享类型,music、video或link，不填默认为link
            trigger:(res)=>{console.log('分享前')},
            success:()=>{},
            fail:(res)=>{console.log("分享失败")},
            cancel:()=>{console.log("分享取消")}
        });
    })
    wx.error((err)=>{
        alert(err.errMsg);
    });
</script>
<div id=share style="display: none">
    <img width=100% src="img/share.png"
         style="position: fixed; z-index: 9999; top: 0; left: 0; display: "
         ontouchstart="document.getElementById('share').style.display='none';">
</div>
<div style="display: none;">
    <script type="text/javascript">

        var myData = {};
        function dp_submitScore(score){
            myscore=score;
            myData.score = score;
            myData.scoreName = score+"对卡片";
            // if(score <= 15){
            //     if (confirm("闯关失败，配成了"+score+"对！要不要通知下小伙伴们呢？")){
            //         dp_share();
            //     }
            // } else if (score > 15){
            //     if (confirm("闯关成功，配成了"+score+"对！要不要通知下小伙伴们呢？")){
            //         dp_share();
            //     }
            // }
        }
        function onShareComplete(res) {
        }
    </script>
</body>
</html>
